import * as Antd from 'ant-design-vue';
import { AnyObject } from 'ant-design-vue/es/_util/type';
import { App } from 'vue';

export default {
  install(app: App): void {
    Object.keys(Antd).forEach(key => {
      if (key === 'default') return;
      const Component = (Antd as AnyObject)[key];
      if (Component.name === undefined) return;
      //   console.log(`${Component.name}`);
      app.component(`${Component.name}`, Component);
    });
  },
};
